<template>
  <div class="mine">
    <div class="left">
      <div class="mine-info">
        <mine-info :userList="userList"></mine-info>

      </div>
    </div>
    <div class="right">
      <div class="mine-media">
        <mine-media :userMeta="userList"></mine-media>
      </div>
      <div class="mine-privacy">
        <mine-privacy :userPri="userList"></mine-privacy>
      </div>
    </div>
    

  </div>
</template>

<script>
  import {
    getUserProfile,
} from '../../../api/user';
  import mineInfo from './mine_info.vue'
  import mineMedia from './mine-media.vue'
  import minePrivacy from './mine-privacy.vue'
export default {
  name: 'mineIndex',
  data() {
    return {
      userList: {
                birth: "",
                createTime: "",
                email: "",
                hobby: "",
                id: "",
                institute: "",
                name: "",
                password: "",
                phoneNumber: "",
                sex: "",
                specialty: "",
                totalTime: null,
                userPic: null,
      }
    }
  },
  props: {

  },
  components: {
    mineInfo,
    mineMedia,
    minePrivacy,
},
  created() {
    this.loadUser()
    },
  mounted() {
    
  },
  methods: {
    loadUser() {
      getUserProfile().then(res => {
        this.userList = res.data.data
        console.log(this.userList)
      });
      
    },

  

    // updateUserInfo() {
    //   const userInfo = {
    //     name: this.user.name,
    //     phonenumber: this.user.phonenumber,
    //     institute: this.user.institute,
    //     specialty: this.user.specialty,
    //     birth: this.user.birth,
    //     sex: this.user.sex,
    //     hobby: this.user.hobby,
    //     email: this.user.email,
    //   }
    //   updateUserProfile(userInfo).then((res) => {
    //     console.log(res);
    //   }).catch((err) => {
    //     console.log(err);
    //   });
    //     }

  }
}
</script>

<style scoped lang="less">
  .mine{
    display: flex;
    div{
      flex:1
    }
  }


</style>
